wowwikifandomcom-20200223-history
Useful macros
Casting spells no longer requires the (Rank x). So you can now have a macro that says: /cast Holy Light, and it'll cast your highest rank of Holy Light. It is not certain whether it will select the highest rank that a lower-level character can accept. =Spells= Self Cast any spell /cast Holy Light /script TargetByName("player"); Just a quick spell for dueling Hunters if you are Shaman: /cast cure poison /script TargetByName("player"); Selfcasting non-enemy spells Some spells can not be cast on enemies. Thus, if you have an enemy targeted, you can cast them on yourself. Example This macro will only cast the spell if it can be cast on you: /script if ( not UnitIsFriend("player", "target") ) then CastSpellByName("Spell"); end /script if ( SpellIsTargeting() ) then SpellTargetUnit("player"); end Cast a spell based on target's class You'll need to target the person you want to buff first. Here's an example for a paladin to use; note that it should all be on one line: /script class = UnitClass("target"); if ( ( class "Rogue" ) or ( class "Warrior" ) ) then CastSpellByName("Blessing of Might"); else CastSpellByName("Blessing of Wisdom"); end Cast a spell based on target's level You'll need to target the person you want to buff first. Here's an example for a priest to use on an English language server. You have to alter the spell name according to the spell you want to cast; note that it should all be on one line: /script Pre="Power Word: Fortitude(Rank " Sp={1,2,14,26,38,50} if (UnitLevel("target") ~= nil and UnitIsFriend("player","target")) then for i=6,1,-1 do if (UnitLevel("target") >= Spi) then CastSpellByName(Pre..i..")") return end end end Announcing spells and targets to your party Good for healing and crowd control spells. Example with a healing spell (Party member must be targeted first to make the party announcement work): /cast Healing Touch /party Healing %t in 3.5 seconds Cast a spell on party member based on his location in party This will target the "first" member of your party, cast a healing spell on him, then return you to your previous target. To use on 2nd member of party change "party1" to "party2". /script TargetUnit("party1") /cast Flash Heal /script TargetLastTarget() Announcing spells and cast on friendly target only This alternative checks to be sure that the current target is a player character. (No more Healing "insert mob here" in 3.5 seconds) Tends to get group members upset if it apears you are trying to heal the mobs. It also sends a whisper to the player you are healing instead of having heal spams for everyone in party chat. (NOTE: Do not include the returns. Doesnt cast on pets.) /script nm = UnitName("target"); pl = UnitIsPlayer("target") if ((nm ~= nil) and (pl 1))then SendChatMessage("Healing you for (143 - 165) in 2.5 sec" , "WHISPER", "COMMON", UnitName("target") ); CastSpellByName("lesser heal"); end = Inventory/Items = Equip an item /script PickupContainerItem(bag, slot); bag goes from 0 to 4, and slot from 1 to 20 (depending on bag size). For more information, go to Item equipping to see how to use items from backpacks, etc., and information on how to prevent accidental vendoring of items due to macros. Use a Bandage /script UseAction(ActionID, 0, 1); /script if( SpellIsTargeting() ) then SpellTargetUnit("player"); end Bandage must be placed in the action bar at the slot given by ActionID. ActionID is a number from 1 to 120. Slot1-ActionBar1 is ActionID1, Slot12 is ActionID12, Slot1-ActionBar2 is ActionID13 and so on up to Slot12 of ActionBar10. This will bandage your target, or yourself if your current target is not a friendly target. Here's a different version courtesy of post by Sarf on the forums. This one will always self-bandage, even if you have a friendly player targeted. It will also re-target your original target. Note that this must all be on one line, its just split up for readability: /script p="player";t="target";if(not UnitCanAttack(t, p))then ot=UnitName(t);TargetUnit(p); else ot=nil;end;UseAction(ActionID);if(SpellIsTargeting())then SpellTargetUnit(p); end if(ot) then TargetByName(ot);end Example {PLEASE PROVIDE AN ACTUAL SAMPLE/EXAMPLE TEXT STRING HERE} Following is another example of self bandaging that does not use scripting. THIS WILL WORK FOR COSMOS USERS ONLY. Shift-clicking on the bandage (or other item in inventory) while editing your macro will insert its name into your macro. Placing the "target" command after the "use" command maintains your primary target and also maintains your combo points for that target if you're a Rogue. /use Heavy Linen Bandage /target player Note: As of WoW UI version 1300, when you use the /target command use player not "player" to target yourself. Script command /target does NOT require Cosmos mod, but the /use command does. You may experience problems with the script above, because it uses non-standard commands. If you place your Heavy bandage in the second ActionBar slot 5 you can use this small macro to use the bandage on your self. This works regardless of whether Cosmos (or any other mod) is installed. /script TargetUnit("player"); /script UseAction(17); You have to use 17, because it is 2nd Actionbar and 5th slot ((2-1)*12+5=17). Reference ActionID's: Actionbar Slot number 1: 1 2 3 4 5 6 7 8 9 10 11 12 2: 13 14 15 16 17 18 19 20 21 22 23 24 3: 25 26 27 28 29 30 31 32 33 34 35 36 4: 37 38 39 40 41 42 43 44 45 46 47 48 5: 49 50 51 52 53 54 55 56 57 58 59 60 6: 61 62 63 64 65 66 67 68 69 70 71 72 = Interface = Switching Hotbars /script CURRENT_ACTIONBAR_PAGE = X; /script ChangeActionBarPage(); Where X is the Hotbar number Example /script CURRENT_ACTIONBAR_PAGE = 1; /script ChangeActionBarPage(); Macro Frame Toggling /script if ( not MacroFrame:IsVisible() ) then ShowUIPanel(MacroFrame); else HideUIPanel(MacroFrame); end; Set Video World Environment Variables Sometimes when you are in a high-traffic area (Ironforge or Orgrimmar in particular), RAM and processors get bogged down. One way to help your computer is to adjust the video settings to improve performance. You can put these macros into hotbars and bind to keys for easy switching, e.g. Shift-\, \, and Ctrl-\ for High, Medium, and Low Res. These don't change the actual resolution of the screen, only the level of detail. LowRes is very good for the Auction House / Bank areas. Also, if your UI needs reset (the rendering isn't working), just switch from one to another. HighRes: /z SetFarclip(777) /z SetWorldDetail(2) /z SetBaseMip(1) MediumRes: /z SetFarclip(477) /z SetWorldDetail(1) /z SetBaseMip(1) LowRes: /z SetFarclip(177) /z SetWorldDetail(0) /z SetBaseMip(0) = Group Combat = Help Tank Character If you are in a group and fighting a larger Group of enemies, and your group tank character is already fighting an enemy, you may not want to attack one which did not have Aggro yet. Select your group tank via key F and execute follow macro. /assist %t /script AttackTarget(); = Pets = Pet Attack /script PetAttack(); A useful extension of this is to have your pet begin assisting your main tank with one button. You could also add a fourth line that casts one of your spells so that you begin fighting too. /target player /assist /script PetAttack(); Attack with Dash: (where Dash is the 4th icon on the pet bar) /script PetAttack(); CastPetAction(4); Pet Passive /script PetPassiveMode(); This is really useful in a Scatter Shot macro: /script PetPassiveMode(); /cast Scatter Shot = Miscellaneous = Local Server time /script hour,min=GetGameTime() /script DEFAULT_CHAT_FRAME:AddMessage(format("Server time is %s:%s",hour,min)); Location /script px,py=GetPlayerMapPosition("player") /script DEFAULT_CHAT_FRAME:AddMessage(format("[ %s ] %s , %s",GetZoneText(),px,py)); ''Value will be between 0,0 (Top Left corner of current map) and 1,1 (Bottom Right) ''A variant that gives a value between 0 and 100, and reduces it to 1 decimal place: /script px,py=GetPlayerMapPosition("player") /script px=floor(px*1000) /script py=floor(py*1000) /script px=px/10 /script py=py/10 /script DEFAULT_CHAT_FRAME:AddMessage(format("%s: %s, %s",GetZoneText(),px,py)); ---- Go to Macros Go to Interface Customization Category:Interface Customization